/**
 * @author Administrator
 */
 /**
  * 权限列表
  */
var rolessort,rolessm,grid=null;
window.onresize = function(){ 
		if(grid !=null)
		{
	        grid.setHeight(0); 
	        grid.setHeight($(window).height()-78); 
		}
	     
};
function initupdateroleslist(){
		 Ext.BLANK_IMAGE_URL=Ext.get('basePath').getValue()+"ajaxFramework/ext-2.1/resources/images/default/s.gif";

	rolessm  = new Ext.grid.CheckboxSelectionModel({
		handleMouseDown:Ext.emptyFn
	});
	var colModel = new Ext.grid.ColumnModel([
		rolessm,
		{header:'权限名称',dataIndex:'name',menuDisabled : true},
		{header:'描述',dataIndex:'description',menuDisabled : true},		
		{header:'id',dataIndex:'id',hidden:true}
	]);
	var url = Ext.get('basePath').getValue()+"tjsinfo/tjsoa/system/selectupdateAllRoles.do?id="+Ext.get('userid').getValue();
	rolessort = new Ext.data.JsonStore({
		url:url,
		fields:['name','description','id','chk']
	});
	 grid = new Ext.grid.GridPanel({
		cm:colModel,
		sm:rolessm,
		renderTo:'rolesdiv',
		store:rolessort,
		loadMask:true,
		height:$(window).height()-78,
		viewConfig:{
			forceFit:true
		}
	});
}

function  selectrolesrows(){
	var rolesid = "";
	var rlolesarray = new Array();
	rlolesarray = rolessm.getSelections();
	for(var i = 0;i<rlolesarray.length;i++)
	{
			rolesid+=rlolesarray[i].get('id') +',';
	}
	$('#rolesid').attr('value',rolesid);
	
}

